package com.zxy.supplier_system.server.xinyuan.controller

import com.qiniu.util.Auth
import com.zxy.supplier_system.server.xinyuan.configuration.QiniuProperties
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("xinyuan/images")
class XinyuanImageUploadController(
    private val auth: Auth,
    private val qiniuProperties: QiniuProperties,
) {

    @GetMapping("upload/token")
    fun getUploadToken(): String {
        return auth.uploadToken(qiniuProperties.bucket)
    }

}